package com.坦克大战.Tank_3;

import javax.swing.*;

@SuppressWarnings("all")
public class TankGameMain extends JFrame {
    public static void main(String[] args) {
        TankGameMain tankGameMain = new TankGameMain();
    }

    MyPanel panel = null;

    public TankGameMain() {
        this.panel = new MyPanel();  ///创建画板
        new Thread(panel).start();   ///启动刷新画板的线程
        this.add(panel);             ///将画板添加到该界面
        this.setSize(1500, 700);   ///画布大小
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);  ///点击 × 就退出
        this.setVisible(true);     ///是否显示
        this.addKeyListener(panel);   ///添加键盘监听到画板

    }

}
